<html ng-app='ShoppingModule'>
<head>
<script type="text/javascript" src="../angular/angular.js"></script>
</head>
<body>

	<h1>Shop!</h1>

	<table ng-controller='ShoppingController'>
		<tr ng-repeat='item in items'>
			<td>{{item.title}}</td>
			<td>{{item.description}}</td>
			<td>{{item.price | number: 1}}</td>
		</tr>
	</table>


</body>

</html>

<script type="text/javascript">
	var shoppingModule = angular.module('ShoppingModule', []);

	shoppingModule.factory('Items', function() {
		var items = {};

		items.query = function() {
			return [ {
				title : 'Paint pots',
				description : 'Pots full of paint',
				price : 3.95
			}, {
				title : 'Ploka dots',
				description : 'Dots with polka',
				price : 2.95
			}, {
				title : 'Pebbles',
				description : 'Just little rocks',
				price : 6.95
			} ];
		};

		return items;
	});

	function ShoppingController($scope, Items) {
		$scope.items = Items.query();
	}
</script>